/// @tags:
#include <algorithm>
#include <cctype>
#include <cstdio>

int const N = 1e2 + 5;

template <typename T>
inline T &read(T &x) {
  x = 0;
  bool f = false;
  short ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = true;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + (ch ^ '0'), ch = getchar();
  if (f) x = -x;
  return x;
}

int n, m;
int a[4][N][N];
char map[N][N];

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("A.in", "r", stdin);
  freopen("A.out", "w", stdout);
#endif
#endif

  read(n), read(m);
  for (int i = 1; i <= n; ++i) { scanf("%s", map[i] + 1); }
  int(*const l)[N] = a[0], (*const t)[N] = a[1], (*const r)[N] = a[2],
             (*const b)[N] = a[3];
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (map[i][j] == '.') {
        l[i][j] = l[i][j - 1] + 1;
        t[i][j] = t[i - 1][j] + 1;
      }
    }
  }
  for (int i = n; i; --i) {
    for (int j = m; j; --j) {
      if (map[i][j] == '.') {
        r[i][j] = r[i][j + 1] + 1;
        b[i][j] = b[i + 1][j] + 1;
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      int min = 0x3f3f3f3f;
      for (int k = 0; k < 4; ++k) { min = std::min(min, a[k][i][j]); }
      if (min >= 2) ++ans;
    }
  }
  printf("%d", ans);
  return 0;
}